package ia;


public class DistanciaManhattan90 implements Heuristica{
    private static DistanciaManhattan90 instancia = new DistanciaManhattan90();

    private DistanciaManhattan90(){}

    public static DistanciaManhattan90 getInstance(){
        return instancia;
    }

    @Override
    public float calculaHeuristica(Nodo nodo, int[] posGertru) {
    	float dHorizontal,dVertical;
        dHorizontal = nodo.getX() - posGertru[0];
        dVertical   = nodo.getY() - posGertru[1];
        
        return (Math.abs(dHorizontal) + Math.abs(dVertical));
    }
}